package cn.ltgodm.moj.service;

import cn.ltgodm.moj.model.dto.questionsubmit.QuestionSubmitAddRequest;
import cn.ltgodm.moj.model.dto.questionsubmit.QuestionSubmitQueryRequest;
import cn.ltgodm.moj.model.entity.Question;
import cn.ltgodm.moj.model.entity.QuestionSubmit;
import cn.ltgodm.moj.model.entity.User;
import cn.ltgodm.moj.model.vo.QuestionSubmitVO;
import cn.ltgodm.moj.model.vo.QuestionVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author wenpeng
* @description 针对表【question_submit(题目提交)】的数据库操作Service
* @createDate 2024-02-28 09:18:31
*/
public interface QuestionSubmitService extends IService<QuestionSubmit> {
    /**
     * 点赞
     *
     * @param questionSubmitAddRequest
     * @param loginUser
     * @return
     */
    long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, User loginUser);

    /**
     * 帖子点赞（内部服务）
     *
     * @param userId
     * @param questionId
     * @return
     */
    int doQuestionSubmitInner(long userId, long questionId);

    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitQueryRequest questionSubmitQueryRequest);

    /**
     * 获取题目封装
     *
     * @param question
     * @param loginUser
     * @return
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit question, User loginUser);

    /**
     * 分页获取题目封装
     *
     * @param questionPage
     * @param loginUser
     * @return
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionPage, User loginUser);
}
